package com.aabbc.rocketmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * OrderConsumer
 *
 * @author: <a href="mailto:chenfenghai@oristartech.com">chenfenghai</a>
 * @version: 1.0
 * @date: 2019-11-27 15:59
 */
@Slf4j
@Component
@RocketMQMessageListener(
        topic = "topic1",
        selectorExpression = "tag1",
        consumerGroup = "group1",
        consumeMode = ConsumeMode.CONCURRENTLY,
        messageModel= MessageModel.CLUSTERING)
public class OrderConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        log.info("1consumer message: {}", s);
    }
}
